Release 10.1A: OpenEdge Data Management:
SQL Reference
ORDER BY clause
Allows ordering of the rows selected by the
SELECTstatement. Unless anORDER BYclause is specified, the rows of the result set might be returned in an unpredictable order as determined by the access paths chosen and other decisions made by the query optimizer. The decisions made will be affected by the statistics generated from table and index data examined by theUPDATE STATISTICScommand.Syntax
exprExpression of one or more columns of the tables specified in the
FROMclause of theSELECTstatement.posnInteger column position of the columns selected by the
SELECTstatement.ASC | DESCIndicates whether to order by ascending order (
ExamplesASC) or descending order. The default isASC.
Notes
- The
ORDER BYclause, if specified, should follow all other clauses of theSELECTstatement.- The selected rows are ordered on the basis of the first
exprorposn. If the values are the same, then the secondexprorposnis used in the ordering.- A query expression can be followed by an optional
ORDER BYclause. If the query expression contains set operators, then theORDER BYclause can specify only the positions.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |